<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="appnode.Interface" %>
<%@ page import="appnode.PMF" %>

<html>
	<head>
	<link rel="stylesheet" href="map.css" type="text/css" media="screen" title="mapcss"></link>
	<title>Add interface</title>
	
	
	<script>
	function checkform() {
		valid=true;
		if (document.input.name.value=="" || document.input.protocol.value=="" || document.input.direction.value==""){
			alert("Fill all fields");
			valid=false;	
		}
	return valid;
	}
	</script>
	</head>
  <body class="window">
	<div class="openwindow">
	<%
		String wrong = request.getParameter("wrong");
	%>
	Add interface for node : <%= request.getParameter("nodename")%>
	<%
		String nodename = request.getParameter("nodename");
	%>

		
	<p>Fill the fields</p>
	<%
		if (wrong!=null) {
			out.print(wrong);
		}
	%>
	<form name="input" action="/addif?nodename" method="get" onsubmit="return checkform()">
	<input type="hidden" name="nodename" value="<%=nodename%>"></input>
	<input type="hidden" name="action" value="save"></input>
	Name : <input type="text" name="name"/><p>
 	Protocol : <select name="protocol"><option value="802.11a">802.11a</optional></select><p>
 	Direction :  <select name="direction"><option value="S">S</optional>
										 <option value="N">N</optional>
										 <option value="E">E</optional>
    									 <option value="W">W</optional>
									     <option value="SE">SE</optional>
										 <option value="SW">SW</optional>
										 <option value="NE">NE</optional>
										 <option value="NW">NW</optional>
	</select><p>
	<input type="submit" value="Save"/>
	<input type='button' value='Cancel' onClick='self.close()'/>
	</form>
	</div>
	</body>
	
	
</html>